package com.jixiang.dictionary.controller;

import com.jixiang.dictionary.service.DsFileService;
import com.jixiang.model.common.dtos.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping("wxFile")
public class WxFileController {
    @Resource
    private DsFileService dsFileService;

    @ApiOperation("微信端用户上传头像图片直接返回路径")
    @PostMapping("/WxUploadIconImgRes")
    public String WxUploadIconImgRes(MultipartFile file, @RequestParam String oldImage) throws IOException {
        return dsFileService.WxUploadIconImgRes(file,oldImage);
    }
}
